package al.ui;

import java.awt.Color;
import java.awt.Cursor;
import java.awt.FlowLayout;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;

import javax.swing.BoxLayout;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class West extends JPanel implements MouseListener,MouseMotionListener{

	JPanel content;
	MenuTest conten;
	
	JLabel l1;
	JLabel l2;
	JLabel l3;
	JLabel l4;
	JLabel z;
	
	public West(String image1,String image2,String image3,String image4, String image5, String image6){
		this.setLayout(new FlowLayout(FlowLayout.LEFT));
		this.setBackground(Color.WHITE);
		content = new JPanel();
		content.setLayout(new BoxLayout(content, BoxLayout.Y_AXIS));
		//for(int i=0;i<image.length;i++){
			
			l1 = new JLabel(new  ImageIcon(image1));
			content.add(l1);
			l1.addMouseListener(this);
			//l1.addMouseMotionListener(this);
			
			l2 = new JLabel(new ImageIcon(image2));
			content.add(l2);
			l2.addMouseListener(this);
			
			l3 = new JLabel(new  ImageIcon(image3));
			content.add(l3);
			l3.addMouseListener(this);
			
			l4 = new JLabel(new  ImageIcon(image4));
			content.add(l4);
			l4.addMouseListener(this);
			z = new JLabel("zikos");
			//Cursor c=new Cursor(Cursor.HAND_CURSOR);
			z.setCursor(new Cursor(Cursor.HAND_CURSOR));
			content.add(z);
			z.addMouseListener(this);
		//}
		
		content.setBackground(Color.WHITE);
		this.add(content);
		
	}
	/*public void test(JPanel p){
		conten = new MaFenetre();
		//conten.content1.add("Center",p);
		conten.setMaFenetere(p);
	}*/
	
	

	public void mouseClicked(MouseEvent event) {
		if (event.getSource() == l1){
		content.removeAll();
		AjouteCourrierArrive c1 = new AjouteCourrierArrive(null);
		Piece_jointe m2 = new Piece_jointe();
		Papillon1 m3 = new Papillon1();
		TabbedPane m = new TabbedPane(new JPanel[]{c1,m2,m3},new String[]{"Courrier","Piece jointe","Papillon"});
		conten = new MenuTest();
		conten.content1.add("Center",m);
		repaint();
		validate();
		
		
		//test(m);
		//conten = new MaFenetre();
		//conten.setMaFenetere(m);
		//conten.content1.add("Center",m);
		//new FenetreMed();
		  }
		//if (event.getSource() == l2){
			//content.removeAll();
			//Vente v = new Vente();
			//TabbedPane m = new TabbedPane(new JPanel[]{v},new String[]{"Vente"});
			//conten = new MaFenetre();
			//conten.content1.add("Center",m);
		//	test(m);
	//	}
		if (event.getSource() == l3){
			content.removeAll();
			Contact f = new Contact();
			TabbedPane m = new TabbedPane(new JPanel[]{f},new String[]{"Contacts"});
			//conten.dispose();
			conten = new MenuTest();
			conten.content1.removeAll();
			conten.content1.add("Center",m);
			repaint();
			validate();
		}
		if (event.getSource() == l4){
			content.removeAll();
			
			conten = new MenuTest();
			//conten.content1.add("Center",m);
			repaint();
			validate();
		}
		
		//new FenetreMed();
			/*content.removeAll();
			Medicaments m = new Medicaments();
			conten = new MaFenetre();
			conten.content1.add("Center",m);*/
	}
	private void setCenter(TabbedPane m, MenuTest conten2) {
		// TODO Auto-generated method stub
		
	}
	public void mouseEntered(MouseEvent event) {
		if(event.getSource()== z){
			System.out.println("test");
		}
    }
	public void mouseExited(MouseEvent event) {
           
	}
	public void mousePressed(MouseEvent event) {
		
	}
	public void mouseReleased(MouseEvent event) {
		
	}
	public void mouseDragged(MouseEvent arg0) {
		/*JPanel n1 = (JPanel) new North(new String[]{"image/centre/medicament.png"});
		conten.content1.remove(Center);
		Center c1 = new Center(n1);*/			
	}
	public void mouseMoved(MouseEvent arg0) {
		//JLabel l = new JLabel(new ImageIcon("image/centre/medicament.png"));
		//conten = new MaFenetre();
	    //conten.c.removeAll();
		//conten.c.add("Center",l);
	//	new MauvaisTest();		
	}
}

